<?php /* Smarty version 2.6.18, created on 2012-05-16 22:29:13
         compiled from ajax/account-basic-introduce.tpl */ ?>
<form method="post" id="frmIntroduce" name="frmIntroduce" action="<?php echo @HOST_VFRIEND; ?>
account/basicsave" enctype="multipart/form-data">
    <input type="hidden" name="ptsave" id="ptsave" value="<?php echo $this->_tpl_vars['intType']; ?>
" />
	<div class="editForm">    	
        <div class="userInput">
        	<div class="lFloat w100pe"><label>Tự giới thiệu:</label><span class="rFloat"><span id="introCount">0</span> ký tự</span></div>
            <textarea rows="0" cols="0" name="pintroduce" id="pintroduce" class="textarea clearIt"><?php if (isset ( $_SESSION['st_introduce'] )): ?><?php echo $_SESSION['st_introduce']; ?>
<?php else: ?><?php echo $this->_tpl_vars['objUser']->introduce; ?>
<?php endif; ?></textarea>
        </div>        
        <div class="userInput">
        	<input type="submit" value="Thay đổi" class="btn" />
            <input type="button" value="Hủy" class="btn" onclick="javascript:basicClose('<?php echo $this->_tpl_vars['strView']; ?>
','<?php echo $this->_tpl_vars['strEdit']; ?>
')" />
        </div>
    </div>
</form>
<script type="text/javascript" language="javascript" src="<?php echo @HOST_STATICS; ?>
js/library/autoresize.jquery.js"></script>
<?php echo '
<script type="text/javascript" language="javascript">
	$(document).ready(function(){		
		$("#frmIntroduce").validate({						
			errorClass		: \'errorMessage\',
			errorElement	: \'span\',
			onfocusout		: false,
			onkeyup			: false,
			rules: {	
				pintroduce:{
					required	: true,
					minlength	: 10
				}
			},
			messages: {	
				pintroduce:{
					required	: introduce_required,
					minlength	: introduce_minlength
				}
			},		
			errorPlacement: function(label, element) {			
				var id = element.attr(\'id\');			
				label.insertAfter($(\'#\' + id));			
			},
			submitHandler: function(form) {		
				form.submit();
			}
		});		
		$(\'textarea#pintroduce\').autoResize({
			// On resize:
			onResize : function() {
				$(this).css({opacity:0.8});
			},
			// After resize:
			animateCallback : function() {
				$(this).css({opacity:1});
			},
			// Quite slow animation:
			animateDuration : 300,
			// More extra space:
			extraSpace : 5
		});
		$(\'#pintroduce\').each(function(){  
			var length = $(this).val().length;		
			$(this).parent().find(\'#introCount\').html( length);  
			$(this).keyup(function(){  			
				var new_length = $(this).val().length; 
				$(this).parent().find(\'#introCount\').html( new_length);  
			});  
			
		});  
	});
</script>
'; ?>